home *** CD-ROM | disk | FTP | other *** search
/ PC Open 100 / PC Open 100 CD 1.bin / CD1 / INTERNET / WEBDESIGN / Tsw WebCoder / tswwebcoder5en.exe / {app} / data / tools / dialog_ol.xml < prev    next >
Encoding:
Extensible Markup Language  |  2004-04-09  |  4.8 KB  |  105 lines

  1. <?xml version="1.0" encoding="iso-8859-1"?>
  2. <dialog width="400" height="380" caption="Ordered list">
  3.     <controls>
  4.         <panel name="mainpanel" caption="" align="alclient" bevelinner="bvnone" bevelouter="bvnone">
  5.             <panel name="pnlMain" caption="" align="altop" taborder="0" hint="" width="383" height="56" top="1" left="1" bevelinner="bvnone" bevelouter="bvnone">
  6.                 <label name="lblItemCount" caption="Number of items" hint="" width="29" height="13" top="16" left="8"/>
  7.                 <label name="lblType" caption="Type" hint="" width="56" height="13" top="16" left="190"/>
  8.                 <combobox name="comType" taborder="1" text="" hint="Select the type of items your list should use." width="170" height="21" top="32" left="190">
  9.                     <items>
  10.                         1
  11.                         a
  12.                         A
  13.                         i
  14.                         I
  15.                     </items>
  16.                 </combobox>
  17.                 <spinedit name="speItemCount" taborder="0" hint="Choose how many items you want in your list." maxvalue="100" minvalue="1" value="1" width="170" height="20" top="32" left="8">
  18.                     <event type="onchange">
  19.                         stgItems.RowCount := speItemCount.Value+1;
  20.                     </event>
  21.                 </spinedit>
  22.             </panel>
  23.             <panel name="pnlList" caption="" align="altop" taborder="1" hint="" width="383" height="143" top="57" left="1" bevelinner="bvnone" bevelouter="bvnone">
  24.                 <label name="lblItems" caption="List elements" hint="" width="81" height="13" top="8" left="8"/>
  25.                 <stringgrid name="stgItems" left="8" top="23" width="353" height="104" rowcount="2" colcount="2" fixedcols="1" fixedrows="1" ctl3d="0" defaultcolwidth="20" defaultrowheight="15"/>
  26.             </panel>
  27.         </panel>
  28.     </controls>
  29.     <dialogevents>
  30.         <event type="onclose" resulttype="ok">
  31.             StartCode := '<ol';
  32.             If comType.Text <> '' then
  33.              StartCode := StartCode + ' type="'+comType.Text+'"';
  34.               If edtCSSClass.Text <> '' then
  35.              StartCode := StartCode + ' class="'+edtCSSClass.Text+'"';
  36.               If edtCSSId.Text <> '' then
  37.                StartCode := StartCode + ' ID="'+edtCSSId.Text+'"';
  38.               If edtCSSStyle.Text <> '' then
  39.                StartCode := StartCode + ' style="'+edtCSSStyle.Text+'"';
  40.             for i := 0 to EventGrid.Count - 1 do
  41.               begin
  42.               if EventGrid.Rows[i].EditText <> '' then
  43.                StartCode := StartCode + ' ' + (EventGrid.Rows[i].Caption+'="' + EventGrid.Rows[i].EditText)+'"';
  44.              end;  
  45.             StartCode := StartCode + '>'; 
  46.             EndCode := #13#10;
  47.             for i := 1 to stgItems.RowCount - 1 do
  48.              EndCode := EndCode + (#9+'<li>' + stgItems.Cells[1,i] + '</li>'+#13#10);            
  49.             EndCode := EndCode + '</ol>';
  50.             If cbMakeXHTMLCompliant.Checked then
  51.              StartCode := MakeXHTMLCompliant(StartCode, true);             
  52.             If cbDoPHPEscape.Checked then
  53.              StartCode := DoPHPEscape(StartCode);
  54.             // A little "hack" - WebCoder will set this, to let us know whether to update
  55.             // an existing tag, or insert a brand new one
  56.             If cbUpdateExistingTag.Checked then 
  57.              ReplaceTag(StartCode)
  58.             else 
  59.                InsertTags(StartCode+EndCode, '');   
  60.               
  61.         </event>
  62.         <event type="onshow">    
  63.             // Specific for this dialog
  64.             stgItems.ColWidths[1] := stgItems.Width - stgItems.ColWidths[0];
  65.             stgItems.Options := [goFixedVertLine, goFixedHorzLine, goVertLine, goHorzLine, goRangeSelect, goEditing];
  66.             If cbUpdateExistingTag.Checked then
  67.              begin
  68.               pnlList.Visible := false;
  69.               Self.Height := Self.Height-pnlList.Height;
  70.               speItemCount.Enabled := false;              
  71.              end;                    
  72.             // Lets put the advanced panel in the right place
  73.             pnlAdvanced.Parent := MainPanel;
  74.             pnlAdvanced.Left := 8;
  75.             pnlAdvanced.Top := MainPanel.Height - 32;        
  76.             pnlAdvanced.Width := Self.Width - 36;
  77.             // Height of the panel will be set internally. Do we need to make the dialog higher to make room for the Advanced panel?
  78.             If pnlAdvanced.Height > 20 then
  79.              Self.Height := Self.Height + 200;
  80.             Self.ActiveControl := MainPanel;
  81.             MainPanel.SetFocus; 
  82.         </event>
  83.         <event type="updatedialog">
  84.             // This event will be called when a user executes the "Edit current tag"-rightclick feature
  85.             // The entire selected tag will be passed as a parameter to this function, that should update
  86.             // the required fields of the dialog.
  87.             function UpdateDialog(Tag: string);
  88.              begin
  89.               comType.Text := GetValueFromAttribute(Tag, 'type');             
  90.                 edtCSSClass.Text := GetValueFromAttribute(Tag, 'class');
  91.                 edtCSSId.Text := GetValueFromAttribute(Tag, 'id');
  92.                 edtCSSStyle.Text := GetValueFromAttribute(Tag, 'style');
  93.               for i := 0 to EventGrid.Count - 1 do
  94.                 begin
  95.                  EventVal := GetValueFromAttribute(Tag, Lowercase(EventGrid.Rows[i].Caption));
  96.                  If EventVal <> '' then
  97.                   EventGrid.Rows[i].EditText := EventVal;
  98.                end;      
  99.               cbDoPHPEscape.Checked := IsPHPEscaped(Tag);
  100.               cbMakeXHTMLCompliant.Checked := isXHTMLDocument();                        
  101.              end;
  102.         </event>
  103.     </dialogevents>
  104. </dialog>
  105.